-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Model label refactor #322
Model label refactor #322
Conversation
…adminteam#319 The model label is now configurable at the model level only, and is no longer configurable at the section level (list, navigate, update,...), as this was considered overkill. This refactoring was in part motivated by issue railsadminteam#319 which reported that display of labels was very inconsistent across various screens, and the label configuration, if given, was not consistently effective. The Labelable module was removed, and the methods model into config/model.rb All references to label across the code have been updated to use the model configuration. Specs updated and passing. Readme also updated accordingly.
…are no longer supported in sections, only at the model level.
+1 These changes simplify unnecessary complexity of label configuration and if this patch is accepted I'd like to do same kind of refactoring with the PS. I think 0.0.2 could consist of this patch, Hideable refactoring and jQuery branch merge to master. |
Merged into master. Technically, if we're following Semantic Versioning (as we should be), backwards-incompatible API changes should require a minor version bump (0.1.0) but I'm not sure this matters so much, since a real rails_admin gem has never been released. |
Thanks for accepting the patch. When are you planning to release a "real gem"? The version on rubygems (0.0.0) is woefully outdated, and I also think the project is definitely in good enough shape to be released as version 0.0.2 now. |
I'd like to hold off releasing rails_admin as a gem until the project is a bit more stable. Since Rails 3 uses bundler, it makes it easy to add a dependency that points to the git repo. |
Fair enough. It seems pretty stable from our end here, and we've been Great work on Rails Admin by the way. It's a well written piece of code and Best, On Wed, Mar 16, 2011 at 2:54 PM, sferik <
www.RubyFocus.biz --- San Francisco --- direct: 650-576-9048 |
Patch as per suggestions in: #319
The gist of it is that I've removed Labelable from the Sections modules and added the methods to the model configuration. You can now set the model's label and also object_label at the model configuration level like so:
It's no longer possible to override the model's name for each section individually, but that feature was never really fully implemented in the first place, in the sense that many display outputs were using the wrong labels (see issue #319).
I've also updated the Readme accordingly as well as the specs -- all passing.
I've updated the gem's version to 0.0.2, in a spearate commit, as this is an API breaking change. The methods "lavel_for_navigation", "label_for_list", etc. are no longer supported. I've left them in, they print a warning but they're effectively no-ops.